<template>
  <div>        <!-- 或者是使用v-if  div v-if= "datalist.length"-->

    <!-- :key="datalist.length" 
            加上这个是为了防止swiper初始化过早,后面再次调用,就会有bug-->
    <swipers :key="dataList.length">
      <!-- 能加class的,会自己添加到组件中里面去 -->
      <file-swiper-item v-for="data in dataList" :key="data" class="xxx">
        {{ data }}
      </file-swiper-item>
    </swipers>
  </div>
</template>

<script>
// import swipers from '@/components/mySwiper/swipers'
import swipers from "./swipers.vue";
import fileSwiperItem from "./fileSwiperItem.vue";
export default {
  data() {
    return {
      dataList: [],
    };
  },
  mounted() {
    setTimeout(() => {
      this.dataList = ["11", "22", "33"];
    }, 1000);
  },
  components: {
    swipers,
    fileSwiperItem,
  },
};
</script>
